package com.kefu.chat.vo;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import com.kefu.common.context.KefuContext;
import com.kefu.common.vo.AbstractUpdateVo;
import com.kefu.chat.model.ChatVideos;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * @author hxh
 * @date 2022/10/26
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(description = "")
public class ChatVideosUpdateVo extends AbstractUpdateVo<ChatVideos,String> {

    @NotEmpty
    @ApiModelProperty(value = "主键")
    private String conversationId;
    @ApiModelProperty(value = "坐席id")
    private String agentId;
    @ApiModelProperty(value = "坐席名称")
    private String agentName;
    @ApiModelProperty(value = "呼叫类型0:语音通话，1:视频通话")
    private Integer videoType;
    @ApiModelProperty(value = "通话类型0:呼出，1:呼入")
    private Integer conversationType;
    @ApiModelProperty(value = "接听状态，0 未接听,1 已接听")
    private Integer videoTimeStatus;
    @ApiModelProperty(value = "通话时长")
    private Long videoTime;
    @ApiModelProperty(value = "用户id")
    private String userId;
    @ApiModelProperty(value = "用户姓名")
    private String userName;

    @Override
    public ChatVideos convert() {
        ChatVideos info  = BeanUtil.toBean(this, ChatVideos.class);
        KefuContext context = KefuContext.getKefuContext();
        info.setUpdateTime(context.getNow());
        return info;
	}
}